package com.snake.spring.boot.smaple.retrofit.controller;

import com.snake.spring.boot.smaple.retrofit.client.CommunityBizClient;
import com.snake.spring.boot.smaple.retrofit.client.base.Result;
import com.snake.spring.boot.smaple.retrofit.client.bo.CommunityIdReq;
import com.snake.spring.boot.smaple.retrofit.client.dto.CommunityRespDTO;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author cheng
 */
@RestController
@RequestMapping("/")
public class CommunityController {

    @Resource
    private CommunityBizClient communityBizClient;

    @GetMapping(value = "getCommunityById")
    public ResponseEntity<Result<CommunityRespDTO>> getCommunityById() {
        CommunityIdReq req = new CommunityIdReq();
        req.setTenantId("1534787163240493056");
        req.setCommunityId("1534787163763589120");
        return ResponseEntity.ok(communityBizClient.getCommunityById(req));
    }

}
